package com.lebang.model.cences;

import com.lebang.domain.CencesEarnDay;
import lombok.Data;

import java.util.List;

/**
 * @Author: hwq
 * @Date: 2020/4/22 14:07
 * @Version 1.0
 */
@Data
public class CencesEarnApru {
    private String time;
    private int allTotal;
    private int vivo;
    private int oppo;
    private int huawei;
    private int xiaomi;
    private int meizu;
    private int sll;
    private int yyb;
    private int xiaozhuo;
    private int csj;
    private int gdt;

    public CencesEarnApru(String time, List<CencesEarnDay> value) {
        this.time = time;
        value.forEach(s -> {
            allTotal = allTotal + s.getSuccessCount();
            System.out.println(s.getBrand());
            switch (s.getBrand()) {
                case "gdt":
                    gdt = gdt + s.getSuccessCount();
                    break;
                case "csj":
                    csj = csj + s.getSuccessCount();
                    break;
                case "vivo":
                    vivo = vivo + s.getSuccessCount();
                    break;
                case "oppo":
                    oppo = oppo + s.getSuccessCount();
                    break;
                case "huawei":
                    huawei = huawei + s.getSuccessCount();
                    break;
                case "xiaomi":
                    xiaomi = xiaomi + s.getSuccessCount();
                    break;
                case "meizu":
                    meizu = meizu + s.getSuccessCount();
                    break;
                case "360":
                    sll = sll + s.getSuccessCount();
                    break;
                case "yingyongbao":
                    yyb = yyb + s.getSuccessCount();
                    break;
                case "xiaozhuozhangshuang":
                    xiaozhuo = xiaozhuo + s.getSuccessCount();
                    break;
                default:
            }
        });
    }

}
